package com.tianyi.sfzy1.controller;

import com.tianyi.sfzy1.domain.Charityactivity;
import com.tianyi.sfzy1.service.CharityactivityService;
import com.tianyi.sfzy1.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/charityactivity")
public class CharityactivityController {
    @Autowired
    private CharityactivityService charityactivityService;
    //公益和咨询师联查
    @RequestMapping("/findAll")
    public R findAll(){
        List<Charityactivity> allCharityactivity = charityactivityService.findAllCharityactivity();
        if (allCharityactivity != null){
            return R.ok(allCharityactivity);
        }else {
            return R.fail("查询失败");
        }
    }

}
